import sys
sys.path.append('../peripherals')

from periphery import GPIO
import time

try:
    gpio = GPIO("/dev/gpiochip1", 1 * 8 + 2, "out")

    # READ
    # while True:
    #     print(gpio.read())
    #     time.sleep(1)

    # WRITE
    value = True
    while True:
        gpio.write(value)
        time.sleep(2)
        value = not value

except Exception as e:
    print(e)
finally:
    gpio.close()
    print('close')